#include "Triangle.h"


Triangle::Triangle(void)
{
}

void Triangle::initPoints() {
	PoligonScreenPosition calculator(getScale(), getType(), getRotation(), getX_position(), getY_position());

	points.clear();

	points.push_back(new Position(calculator.getVerticeOneX(), calculator.getVerticeOneY()));
	points.push_back(new Position(calculator.getVerticeTwoX(), calculator.getVerticeTwoY()));
	points.push_back(new Position(calculator.getVerticeThreeX(), calculator.getVerticeThreeY()));
}

void Triangle::setScale(float scale){
	this->scale = scale;
}
float Triangle::getScale(){
	return this->scale;
}

Figure* Triangle::clone() {
	Triangle* figure = new Triangle();

	figure->setScale(this->scale);
	figure->set_position(this->getX_position(), this->getY_position());
	figure->setColor(this->getColor());
	figure->setRGBColor(this->getRedComponent(), this->getGreenComponent(), this->getBlueComponent());
	figure->setRotation(0);
	figure->setInitialRotation(this->getRotation());
	figure->setStaticFlag(this->is_static());
	figure->setMass(this->getMass());

	return figure;
}

Triangle::~Triangle(void)
{
}
